package com.snopy.designPattern.structure.flyweight;

import com.snopy.designPattern.structure.flyweight.inter.RaceCar;

/**
 * @author snopy
 * @version 1.0.0
 * @classname RaceCarClient
 * @description
 * @email 77912204@qq.com
 * @date 2022/03/03 18:42
 */
public class RaceCarClient {
    private RaceCar raceCar;

    public RaceCarClient(String name) {
        this.raceCar = RaceCarFactory.getRaceCar(name);
    }
    private int currentX = 0;
    private int currentY = 0;
    public void moveCar(int newX,int newY){
        raceCar.moveCar(currentX,currentY,newX,newY);
        currentX = newX;
        currentY = newY;
    }


}
